package com.liuchuanzheng.lcz_compose_news.viewmodel

import androidx.lifecycle.MutableLiveData
import com.liuchuanzheng.lcz_compose_news.http.ApiService
import com.liuchuanzheng.lcz_compose_news.model.NewsModelModel
import com.liuchuanzheng.lcz_compose_news.model.StoryModel

/**
 * @author 刘传政
 * @date 2021/8/2 11:21
 * QQ:1052374416
 * 电话:18501231486
 * 作用:
 * 注意事项:
 */
class NewsViewModel:BaseViewModel() {
    val newsLiveData = MutableLiveData<NewsModelModel>()
    fun getNewsLists(){
        launch {
            val newsModel = ApiService.getNews()
            //Banner占位
            newsModel.stories.add(0, StoryModel())
            newsLiveData.value = newsModel
        }
    }
}